




/*
'===============================================================================
'  MP.LayerHelper.MP_OBS.BL.LgLogObjectDataManagerBase
'===============================================================================
*/

using System;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using MP.LayerHelper.MP_OBS.BLL;
using MP.LayerHelper.MP_OBS.DAL;
using MP.LayerHelper.MP_OBS.DAL.EntityClasses;
using MP.LayerHelper.MP_OBS.DAL.FactoryClasses;
using MP.LayerHelper.MP_OBS.DAL.HelperClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;

namespace MP.LayerHelper.MP_OBS.BLL
{
	public class LgLogObjectDataManagerBase : ManagerBase
	{
		/// <summary>
		/// Purpose: Class constructor.
		/// </summary>
		
		public LgLogObjectDataManagerBase()
		{
			// Nothing for now.
		}
		
		public override string TableName()
        {
            return "LgLogObjectData";
        }
		
		public LgLogObjectDataEntity Insert(LgLogObjectDataEntity _LgLogObjectDataEntity)
		{
			return Insert(_LgLogObjectDataEntity, "");
		}
		
		public LgLogObjectDataEntity Insert(LgLogObjectDataEntity _LgLogObjectDataEntity, string controlId)
		{
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.SaveEntity(_LgLogObjectDataEntity, true);
				LgLogObjectDataFields field = new LgLogObjectDataFields();
                LogEntity(_LgLogObjectDataEntity, field, AcInsert, controlId);
			}
			return _LgLogObjectDataEntity;
		}

		
		public LgLogObjectDataEntity Insert(Guid Id, Guid EmployeeId, string UserName, Guid RecordId, string DataLog, DateTime LogDate, string TableName, string PageUrl, string ControlId, string ModuleId, string Action, string ClientIp)
		{
			LgLogObjectDataEntity _LgLogObjectDataEntity = new LgLogObjectDataEntity();
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				
				_LgLogObjectDataEntity.Id = Id;
				_LgLogObjectDataEntity.EmployeeId = EmployeeId;
				_LgLogObjectDataEntity.UserName = UserName;
				_LgLogObjectDataEntity.RecordId = RecordId;
				_LgLogObjectDataEntity.DataLog = DataLog;
				_LgLogObjectDataEntity.LogDate = LogDate;
				_LgLogObjectDataEntity.TableName = TableName;
				_LgLogObjectDataEntity.PageUrl = PageUrl;
				_LgLogObjectDataEntity.ControlId = ControlId;
				_LgLogObjectDataEntity.ModuleId = ModuleId;
				_LgLogObjectDataEntity.Action = Action;
				_LgLogObjectDataEntity.ClientIp = ClientIp;
				LgLogObjectDataFields field = new LgLogObjectDataFields();
                LogEntity(_LgLogObjectDataEntity, field, AcInsert);
				adapter.SaveEntity(_LgLogObjectDataEntity, true);
			}
			return _LgLogObjectDataEntity;
		}

		public LgLogObjectDataEntity Insert(Guid EmployeeId, string UserName, Guid RecordId, string DataLog, DateTime LogDate, string TableName, string PageUrl, string ControlId, string ModuleId, string Action, string ClientIp)
		{
			LgLogObjectDataEntity _LgLogObjectDataEntity = new LgLogObjectDataEntity();
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				
				_LgLogObjectDataEntity.EmployeeId = EmployeeId;
				_LgLogObjectDataEntity.UserName = UserName;
				_LgLogObjectDataEntity.RecordId = RecordId;
				_LgLogObjectDataEntity.DataLog = DataLog;
				_LgLogObjectDataEntity.LogDate = LogDate;
				_LgLogObjectDataEntity.TableName = TableName;
				_LgLogObjectDataEntity.PageUrl = PageUrl;
				_LgLogObjectDataEntity.ControlId = ControlId;
				_LgLogObjectDataEntity.ModuleId = ModuleId;
				_LgLogObjectDataEntity.Action = Action;
				_LgLogObjectDataEntity.ClientIp = ClientIp;
				adapter.SaveEntity(_LgLogObjectDataEntity, true);
				LgLogObjectDataFields field = new LgLogObjectDataFields();
                LogEntity(_LgLogObjectDataEntity, field, AcInsert);
			}
			return _LgLogObjectDataEntity;
		}
		
		public bool Update(LgLogObjectDataEntity _LgLogObjectDataEntity)
        {
            return Update(_LgLogObjectDataEntity, "");
        }

		public bool Update(LgLogObjectDataEntity _LgLogObjectDataEntity, string controlId)
		{
			bool toReturn = false;
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				RelationPredicateBucket filter = new RelationPredicateBucket();
				IPredicateExpression _PredicateExpression = new PredicateExpression();
				_PredicateExpression.Add(LgLogObjectDataFields.Id == _LgLogObjectDataEntity.Id);
					
				filter.PredicateExpression.Add(_PredicateExpression);

				adapter.UpdateEntitiesDirectly(_LgLogObjectDataEntity, filter);
				toReturn = true;
				
				LgLogObjectDataFields field = new LgLogObjectDataFields();
                LogEntity(_LgLogObjectDataEntity, field, AcUpdate, controlId);
			}
			return toReturn;
		}
		
		public bool Update(LgLogObjectDataEntity _LgLogObjectDataEntity, RelationPredicateBucket filter)
		{
			bool toReturn = false;
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.UpdateEntitiesDirectly(_LgLogObjectDataEntity, filter);
				toReturn = true;
				
				LgLogObjectDataFields field = new LgLogObjectDataFields();
                LogEntity(_LgLogObjectDataEntity, field, AcUpdate);
			}
			return toReturn;
		}

		public bool Update(Guid Id, Guid EmployeeId, string UserName, Guid RecordId, string DataLog, DateTime LogDate, string TableName, string PageUrl, string ControlId, string ModuleId, string Action, string ClientIp)
		{
			bool toReturn = false;
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				LgLogObjectDataEntity _LgLogObjectDataEntity = new LgLogObjectDataEntity(Id);
				if (adapter.FetchEntity(_LgLogObjectDataEntity))
				{
				
					_LgLogObjectDataEntity.EmployeeId = EmployeeId;
					_LgLogObjectDataEntity.UserName = UserName;
					_LgLogObjectDataEntity.RecordId = RecordId;
					_LgLogObjectDataEntity.DataLog = DataLog;
					_LgLogObjectDataEntity.LogDate = LogDate;
					_LgLogObjectDataEntity.TableName = TableName;
					_LgLogObjectDataEntity.PageUrl = PageUrl;
					_LgLogObjectDataEntity.ControlId = ControlId;
					_LgLogObjectDataEntity.ModuleId = ModuleId;
					_LgLogObjectDataEntity.Action = Action;
					_LgLogObjectDataEntity.ClientIp = ClientIp;
					adapter.SaveEntity(_LgLogObjectDataEntity, true);
					toReturn = true;
					
					LgLogObjectDataFields field = new LgLogObjectDataFields();
					LogEntity(_LgLogObjectDataEntity, field, AcUpdate);
				}
			}
			return toReturn;
		}

		public bool Delete(Guid Id)
		{
			bool toReturn = false;
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				LgLogObjectDataEntity _LgLogObjectDataEntity = new LgLogObjectDataEntity(Id);
				if (adapter.FetchEntity(_LgLogObjectDataEntity))
				{
					adapter.DeleteEntity(_LgLogObjectDataEntity);
					toReturn = true;
				}
			}
			return toReturn;
		}
		
		public void DeleteAll() 
		{
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.DeleteEntitiesDirectly("LgLogObjectDataEntity", null);
			}
		}
		
		
		public int DeleteById(Guid Id)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.Id == Id);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("LgLogObjectDataEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByEmployeeId(Guid EmployeeId)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.EmployeeId == EmployeeId);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("LgLogObjectDataEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByUserName(string UserName)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.UserName == UserName);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("LgLogObjectDataEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByRecordId(Guid RecordId)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.RecordId == RecordId);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("LgLogObjectDataEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByDataLog(string DataLog)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.DataLog == DataLog);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("LgLogObjectDataEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByLogDate(DateTime LogDate)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.LogDate == LogDate);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("LgLogObjectDataEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByTableName(string TableName)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.TableName == TableName);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("LgLogObjectDataEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByPageUrl(string PageUrl)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.PageUrl == PageUrl);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("LgLogObjectDataEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByControlId(string ControlId)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.ControlId == ControlId);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("LgLogObjectDataEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByModuleId(string ModuleId)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.ModuleId == ModuleId);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("LgLogObjectDataEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByAction(string Action)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.Action == Action);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("LgLogObjectDataEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByClientIp(string ClientIp)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.ClientIp == ClientIp);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("LgLogObjectDataEntity", filter);
			}
			return toReturn;
		}
		

		
		public LgLogObjectDataEntity SelectOne(Guid Id)
		{
			LgLogObjectDataEntity toReturn = null;
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				LgLogObjectDataEntity _LgLogObjectDataEntity = new LgLogObjectDataEntity(Id);
				if (adapter.FetchEntity(_LgLogObjectDataEntity))
				{
					toReturn = _LgLogObjectDataEntity;
				}
			}
			return toReturn;
		}

		// Return DataTable
		public DataTable SelectAllRDT()
		{
			DataTable toReturn = new DataTable();
			EntityCollection _LgLogObjectDataCollection = new EntityCollection(new LgLogObjectDataEntityFactory());
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_LgLogObjectDataCollection.EntityFactoryToUse.CreateFields(), toReturn, null, true);
			}
			return toReturn;
		}
		
		// Return EntityCollection<LgLogObjectDataEntity>
		public EntityCollection<LgLogObjectDataEntity> SelectAllLST()
		{
			EntityCollection<LgLogObjectDataEntity> _LgLogObjectDataCollection = new EntityCollection<LgLogObjectDataEntity>();
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_LgLogObjectDataCollection, null, 0, null);
			}
			return _LgLogObjectDataCollection;
		}
		
		// Return EntityCollection<LgLogObjectDataEntity>
		public EntityCollection<LgLogObjectDataEntity> SelectAllLST_Paged(int PageNumber, int PageSize)
		{
			EntityCollection<LgLogObjectDataEntity> _LgLogObjectDataCollection = new EntityCollection<LgLogObjectDataEntity>();
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_LgLogObjectDataCollection, null, 0, null, null, PageNumber, PageSize);
			}
			return _LgLogObjectDataCollection;
		}


		
		// Return EntityCollection<LgLogObjectDataEntity>
		public EntityCollection<LgLogObjectDataEntity> SelectByIdLST(Guid Id)
		{
			EntityCollection<LgLogObjectDataEntity> _LgLogObjectDataCollection = new EntityCollection<LgLogObjectDataEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.Id == Id);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_LgLogObjectDataCollection, filter, 0, null);
			}
			return _LgLogObjectDataCollection;
		}
		
		// Return EntityCollection<LgLogObjectDataEntity>
		public EntityCollection<LgLogObjectDataEntity> SelectByIdLST_Paged(Guid Id, int PageNumber, int PageSize)
		{
			EntityCollection<LgLogObjectDataEntity> _LgLogObjectDataCollection = new EntityCollection<LgLogObjectDataEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.Id == Id);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_LgLogObjectDataCollection, filter, 0, null, null, PageNumber, PageSize);
			}
			return _LgLogObjectDataCollection;
		}
		
		// Return DataTable
		public DataTable SelectByIdRDT(Guid Id)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _LgLogObjectDataCollection = new EntityCollection(new LgLogObjectDataEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.Id == Id);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_LgLogObjectDataCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return DataTable
		public DataTable SelectByIdRDT_Paged(Guid Id, int PageNumber, int PageSize)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _LgLogObjectDataCollection = new EntityCollection(new LgLogObjectDataEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.Id == Id);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_LgLogObjectDataCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, 0, null, true, null, PageNumber, PageSize);
			}
			return toReturn;
		}


		
		// Return EntityCollection<LgLogObjectDataEntity>
		public EntityCollection<LgLogObjectDataEntity> SelectByEmployeeIdLST(Guid EmployeeId)
		{
			EntityCollection<LgLogObjectDataEntity> _LgLogObjectDataCollection = new EntityCollection<LgLogObjectDataEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.EmployeeId == EmployeeId);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_LgLogObjectDataCollection, filter, 0, null);
			}
			return _LgLogObjectDataCollection;
		}
		
		// Return EntityCollection<LgLogObjectDataEntity>
		public EntityCollection<LgLogObjectDataEntity> SelectByEmployeeIdLST_Paged(Guid EmployeeId, int PageNumber, int PageSize)
		{
			EntityCollection<LgLogObjectDataEntity> _LgLogObjectDataCollection = new EntityCollection<LgLogObjectDataEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.EmployeeId == EmployeeId);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_LgLogObjectDataCollection, filter, 0, null, null, PageNumber, PageSize);
			}
			return _LgLogObjectDataCollection;
		}
		
		// Return DataTable
		public DataTable SelectByEmployeeIdRDT(Guid EmployeeId)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _LgLogObjectDataCollection = new EntityCollection(new LgLogObjectDataEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.EmployeeId == EmployeeId);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_LgLogObjectDataCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return DataTable
		public DataTable SelectByEmployeeIdRDT_Paged(Guid EmployeeId, int PageNumber, int PageSize)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _LgLogObjectDataCollection = new EntityCollection(new LgLogObjectDataEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.EmployeeId == EmployeeId);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_LgLogObjectDataCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, 0, null, true, null, PageNumber, PageSize);
			}
			return toReturn;
		}


		
		// Return EntityCollection<LgLogObjectDataEntity>
		public EntityCollection<LgLogObjectDataEntity> SelectByUserNameLST(string UserName)
		{
			EntityCollection<LgLogObjectDataEntity> _LgLogObjectDataCollection = new EntityCollection<LgLogObjectDataEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.UserName == UserName);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_LgLogObjectDataCollection, filter, 0, null);
			}
			return _LgLogObjectDataCollection;
		}
		
		// Return EntityCollection<LgLogObjectDataEntity>
		public EntityCollection<LgLogObjectDataEntity> SelectByUserNameLST_Paged(string UserName, int PageNumber, int PageSize)
		{
			EntityCollection<LgLogObjectDataEntity> _LgLogObjectDataCollection = new EntityCollection<LgLogObjectDataEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.UserName == UserName);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_LgLogObjectDataCollection, filter, 0, null, null, PageNumber, PageSize);
			}
			return _LgLogObjectDataCollection;
		}
		
		// Return DataTable
		public DataTable SelectByUserNameRDT(string UserName)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _LgLogObjectDataCollection = new EntityCollection(new LgLogObjectDataEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.UserName == UserName);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_LgLogObjectDataCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return DataTable
		public DataTable SelectByUserNameRDT_Paged(string UserName, int PageNumber, int PageSize)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _LgLogObjectDataCollection = new EntityCollection(new LgLogObjectDataEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.UserName == UserName);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_LgLogObjectDataCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, 0, null, true, null, PageNumber, PageSize);
			}
			return toReturn;
		}


		
		// Return EntityCollection<LgLogObjectDataEntity>
		public EntityCollection<LgLogObjectDataEntity> SelectByRecordIdLST(Guid RecordId)
		{
			EntityCollection<LgLogObjectDataEntity> _LgLogObjectDataCollection = new EntityCollection<LgLogObjectDataEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.RecordId == RecordId);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_LgLogObjectDataCollection, filter, 0, null);
			}
			return _LgLogObjectDataCollection;
		}
		
		// Return EntityCollection<LgLogObjectDataEntity>
		public EntityCollection<LgLogObjectDataEntity> SelectByRecordIdLST_Paged(Guid RecordId, int PageNumber, int PageSize)
		{
			EntityCollection<LgLogObjectDataEntity> _LgLogObjectDataCollection = new EntityCollection<LgLogObjectDataEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.RecordId == RecordId);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_LgLogObjectDataCollection, filter, 0, null, null, PageNumber, PageSize);
			}
			return _LgLogObjectDataCollection;
		}
		
		// Return DataTable
		public DataTable SelectByRecordIdRDT(Guid RecordId)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _LgLogObjectDataCollection = new EntityCollection(new LgLogObjectDataEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.RecordId == RecordId);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_LgLogObjectDataCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return DataTable
		public DataTable SelectByRecordIdRDT_Paged(Guid RecordId, int PageNumber, int PageSize)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _LgLogObjectDataCollection = new EntityCollection(new LgLogObjectDataEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.RecordId == RecordId);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_LgLogObjectDataCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, 0, null, true, null, PageNumber, PageSize);
			}
			return toReturn;
		}


		
		// Return EntityCollection<LgLogObjectDataEntity>
		public EntityCollection<LgLogObjectDataEntity> SelectByDataLogLST(string DataLog)
		{
			EntityCollection<LgLogObjectDataEntity> _LgLogObjectDataCollection = new EntityCollection<LgLogObjectDataEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.DataLog == DataLog);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_LgLogObjectDataCollection, filter, 0, null);
			}
			return _LgLogObjectDataCollection;
		}
		
		// Return EntityCollection<LgLogObjectDataEntity>
		public EntityCollection<LgLogObjectDataEntity> SelectByDataLogLST_Paged(string DataLog, int PageNumber, int PageSize)
		{
			EntityCollection<LgLogObjectDataEntity> _LgLogObjectDataCollection = new EntityCollection<LgLogObjectDataEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.DataLog == DataLog);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_LgLogObjectDataCollection, filter, 0, null, null, PageNumber, PageSize);
			}
			return _LgLogObjectDataCollection;
		}
		
		// Return DataTable
		public DataTable SelectByDataLogRDT(string DataLog)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _LgLogObjectDataCollection = new EntityCollection(new LgLogObjectDataEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.DataLog == DataLog);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_LgLogObjectDataCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return DataTable
		public DataTable SelectByDataLogRDT_Paged(string DataLog, int PageNumber, int PageSize)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _LgLogObjectDataCollection = new EntityCollection(new LgLogObjectDataEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.DataLog == DataLog);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_LgLogObjectDataCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, 0, null, true, null, PageNumber, PageSize);
			}
			return toReturn;
		}


		
		// Return EntityCollection<LgLogObjectDataEntity>
		public EntityCollection<LgLogObjectDataEntity> SelectByLogDateLST(DateTime LogDate)
		{
			EntityCollection<LgLogObjectDataEntity> _LgLogObjectDataCollection = new EntityCollection<LgLogObjectDataEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.LogDate == LogDate);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_LgLogObjectDataCollection, filter, 0, null);
			}
			return _LgLogObjectDataCollection;
		}
		
		// Return EntityCollection<LgLogObjectDataEntity>
		public EntityCollection<LgLogObjectDataEntity> SelectByLogDateLST_Paged(DateTime LogDate, int PageNumber, int PageSize)
		{
			EntityCollection<LgLogObjectDataEntity> _LgLogObjectDataCollection = new EntityCollection<LgLogObjectDataEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.LogDate == LogDate);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_LgLogObjectDataCollection, filter, 0, null, null, PageNumber, PageSize);
			}
			return _LgLogObjectDataCollection;
		}
		
		// Return DataTable
		public DataTable SelectByLogDateRDT(DateTime LogDate)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _LgLogObjectDataCollection = new EntityCollection(new LgLogObjectDataEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.LogDate == LogDate);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_LgLogObjectDataCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return DataTable
		public DataTable SelectByLogDateRDT_Paged(DateTime LogDate, int PageNumber, int PageSize)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _LgLogObjectDataCollection = new EntityCollection(new LgLogObjectDataEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.LogDate == LogDate);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_LgLogObjectDataCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, 0, null, true, null, PageNumber, PageSize);
			}
			return toReturn;
		}


		
		// Return EntityCollection<LgLogObjectDataEntity>
		public EntityCollection<LgLogObjectDataEntity> SelectByTableNameLST(string TableName)
		{
			EntityCollection<LgLogObjectDataEntity> _LgLogObjectDataCollection = new EntityCollection<LgLogObjectDataEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.TableName == TableName);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_LgLogObjectDataCollection, filter, 0, null);
			}
			return _LgLogObjectDataCollection;
		}
		
		// Return EntityCollection<LgLogObjectDataEntity>
		public EntityCollection<LgLogObjectDataEntity> SelectByTableNameLST_Paged(string TableName, int PageNumber, int PageSize)
		{
			EntityCollection<LgLogObjectDataEntity> _LgLogObjectDataCollection = new EntityCollection<LgLogObjectDataEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.TableName == TableName);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_LgLogObjectDataCollection, filter, 0, null, null, PageNumber, PageSize);
			}
			return _LgLogObjectDataCollection;
		}
		
		// Return DataTable
		public DataTable SelectByTableNameRDT(string TableName)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _LgLogObjectDataCollection = new EntityCollection(new LgLogObjectDataEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.TableName == TableName);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_LgLogObjectDataCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return DataTable
		public DataTable SelectByTableNameRDT_Paged(string TableName, int PageNumber, int PageSize)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _LgLogObjectDataCollection = new EntityCollection(new LgLogObjectDataEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.TableName == TableName);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_LgLogObjectDataCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, 0, null, true, null, PageNumber, PageSize);
			}
			return toReturn;
		}


		
		// Return EntityCollection<LgLogObjectDataEntity>
		public EntityCollection<LgLogObjectDataEntity> SelectByPageUrlLST(string PageUrl)
		{
			EntityCollection<LgLogObjectDataEntity> _LgLogObjectDataCollection = new EntityCollection<LgLogObjectDataEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.PageUrl == PageUrl);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_LgLogObjectDataCollection, filter, 0, null);
			}
			return _LgLogObjectDataCollection;
		}
		
		// Return EntityCollection<LgLogObjectDataEntity>
		public EntityCollection<LgLogObjectDataEntity> SelectByPageUrlLST_Paged(string PageUrl, int PageNumber, int PageSize)
		{
			EntityCollection<LgLogObjectDataEntity> _LgLogObjectDataCollection = new EntityCollection<LgLogObjectDataEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.PageUrl == PageUrl);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_LgLogObjectDataCollection, filter, 0, null, null, PageNumber, PageSize);
			}
			return _LgLogObjectDataCollection;
		}
		
		// Return DataTable
		public DataTable SelectByPageUrlRDT(string PageUrl)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _LgLogObjectDataCollection = new EntityCollection(new LgLogObjectDataEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.PageUrl == PageUrl);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_LgLogObjectDataCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return DataTable
		public DataTable SelectByPageUrlRDT_Paged(string PageUrl, int PageNumber, int PageSize)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _LgLogObjectDataCollection = new EntityCollection(new LgLogObjectDataEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.PageUrl == PageUrl);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_LgLogObjectDataCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, 0, null, true, null, PageNumber, PageSize);
			}
			return toReturn;
		}


		
		// Return EntityCollection<LgLogObjectDataEntity>
		public EntityCollection<LgLogObjectDataEntity> SelectByControlIdLST(string ControlId)
		{
			EntityCollection<LgLogObjectDataEntity> _LgLogObjectDataCollection = new EntityCollection<LgLogObjectDataEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.ControlId == ControlId);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_LgLogObjectDataCollection, filter, 0, null);
			}
			return _LgLogObjectDataCollection;
		}
		
		// Return EntityCollection<LgLogObjectDataEntity>
		public EntityCollection<LgLogObjectDataEntity> SelectByControlIdLST_Paged(string ControlId, int PageNumber, int PageSize)
		{
			EntityCollection<LgLogObjectDataEntity> _LgLogObjectDataCollection = new EntityCollection<LgLogObjectDataEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.ControlId == ControlId);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_LgLogObjectDataCollection, filter, 0, null, null, PageNumber, PageSize);
			}
			return _LgLogObjectDataCollection;
		}
		
		// Return DataTable
		public DataTable SelectByControlIdRDT(string ControlId)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _LgLogObjectDataCollection = new EntityCollection(new LgLogObjectDataEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.ControlId == ControlId);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_LgLogObjectDataCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return DataTable
		public DataTable SelectByControlIdRDT_Paged(string ControlId, int PageNumber, int PageSize)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _LgLogObjectDataCollection = new EntityCollection(new LgLogObjectDataEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.ControlId == ControlId);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_LgLogObjectDataCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, 0, null, true, null, PageNumber, PageSize);
			}
			return toReturn;
		}


		
		// Return EntityCollection<LgLogObjectDataEntity>
		public EntityCollection<LgLogObjectDataEntity> SelectByModuleIdLST(string ModuleId)
		{
			EntityCollection<LgLogObjectDataEntity> _LgLogObjectDataCollection = new EntityCollection<LgLogObjectDataEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.ModuleId == ModuleId);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_LgLogObjectDataCollection, filter, 0, null);
			}
			return _LgLogObjectDataCollection;
		}
		
		// Return EntityCollection<LgLogObjectDataEntity>
		public EntityCollection<LgLogObjectDataEntity> SelectByModuleIdLST_Paged(string ModuleId, int PageNumber, int PageSize)
		{
			EntityCollection<LgLogObjectDataEntity> _LgLogObjectDataCollection = new EntityCollection<LgLogObjectDataEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.ModuleId == ModuleId);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_LgLogObjectDataCollection, filter, 0, null, null, PageNumber, PageSize);
			}
			return _LgLogObjectDataCollection;
		}
		
		// Return DataTable
		public DataTable SelectByModuleIdRDT(string ModuleId)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _LgLogObjectDataCollection = new EntityCollection(new LgLogObjectDataEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.ModuleId == ModuleId);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_LgLogObjectDataCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return DataTable
		public DataTable SelectByModuleIdRDT_Paged(string ModuleId, int PageNumber, int PageSize)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _LgLogObjectDataCollection = new EntityCollection(new LgLogObjectDataEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.ModuleId == ModuleId);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_LgLogObjectDataCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, 0, null, true, null, PageNumber, PageSize);
			}
			return toReturn;
		}


		
		// Return EntityCollection<LgLogObjectDataEntity>
		public EntityCollection<LgLogObjectDataEntity> SelectByActionLST(string Action)
		{
			EntityCollection<LgLogObjectDataEntity> _LgLogObjectDataCollection = new EntityCollection<LgLogObjectDataEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.Action == Action);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_LgLogObjectDataCollection, filter, 0, null);
			}
			return _LgLogObjectDataCollection;
		}
		
		// Return EntityCollection<LgLogObjectDataEntity>
		public EntityCollection<LgLogObjectDataEntity> SelectByActionLST_Paged(string Action, int PageNumber, int PageSize)
		{
			EntityCollection<LgLogObjectDataEntity> _LgLogObjectDataCollection = new EntityCollection<LgLogObjectDataEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.Action == Action);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_LgLogObjectDataCollection, filter, 0, null, null, PageNumber, PageSize);
			}
			return _LgLogObjectDataCollection;
		}
		
		// Return DataTable
		public DataTable SelectByActionRDT(string Action)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _LgLogObjectDataCollection = new EntityCollection(new LgLogObjectDataEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.Action == Action);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_LgLogObjectDataCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return DataTable
		public DataTable SelectByActionRDT_Paged(string Action, int PageNumber, int PageSize)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _LgLogObjectDataCollection = new EntityCollection(new LgLogObjectDataEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.Action == Action);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_LgLogObjectDataCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, 0, null, true, null, PageNumber, PageSize);
			}
			return toReturn;
		}


		
		// Return EntityCollection<LgLogObjectDataEntity>
		public EntityCollection<LgLogObjectDataEntity> SelectByClientIpLST(string ClientIp)
		{
			EntityCollection<LgLogObjectDataEntity> _LgLogObjectDataCollection = new EntityCollection<LgLogObjectDataEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.ClientIp == ClientIp);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_LgLogObjectDataCollection, filter, 0, null);
			}
			return _LgLogObjectDataCollection;
		}
		
		// Return EntityCollection<LgLogObjectDataEntity>
		public EntityCollection<LgLogObjectDataEntity> SelectByClientIpLST_Paged(string ClientIp, int PageNumber, int PageSize)
		{
			EntityCollection<LgLogObjectDataEntity> _LgLogObjectDataCollection = new EntityCollection<LgLogObjectDataEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.ClientIp == ClientIp);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_LgLogObjectDataCollection, filter, 0, null, null, PageNumber, PageSize);
			}
			return _LgLogObjectDataCollection;
		}
		
		// Return DataTable
		public DataTable SelectByClientIpRDT(string ClientIp)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _LgLogObjectDataCollection = new EntityCollection(new LgLogObjectDataEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.ClientIp == ClientIp);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_LgLogObjectDataCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return DataTable
		public DataTable SelectByClientIpRDT_Paged(string ClientIp, int PageNumber, int PageSize)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _LgLogObjectDataCollection = new EntityCollection(new LgLogObjectDataEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(LgLogObjectDataFields.ClientIp == ClientIp);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_LgLogObjectDataCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, 0, null, true, null, PageNumber, PageSize);
			}
			return toReturn;
		}


		
		

	}
}
